﻿@model List<DealKhuyenMaiV2.com.Models.Product>
@{
    ViewBag.Title = "G2 group - Trang chủ";
    Layout = "~/Views/Shared/_MemberGuestLayout.cshtml";
}
<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    <link href="@Url.Content("/Content/DefaultThemes/Styles/MemberGuestLayoutStyle.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/slides.min.jquery.js")" type="text/javascript"></script>
    
</head>
<body>
    <div class="col_left">
        <!-------Begin Box Deal lon---------->
        @if (Model.Count > 0)
        {
        <div class="box_deal_lon">
            <div class="title_deal_lon">
                <h1>
                    @Html.ActionLink(Model[0].NameProduct, "Details", new { idProduct = Model[0].IDProduct })
                </h1>
            </div>
            <!-- Nho them the h1 vao day -->
            <div id="deal_info_lon">
                <div id="arrow_lon">
                    <div class="gia_deal_lon">
                        @(Model[0].Price - Model[0].Discount)đ</div>
                    <div class="button_lon">
                        <input type="button" class="btn_mua_lon" onclick="location.href='@Url.Action("ShoppingCart", "Home", new { idProduct = Model[0].IDProduct })'"></div>
                </div>
                <div id="tem_lon">
                    <div class="text_giam">
                        GIẢM</div>
                    <div class="phantram_lon">
                        @Math.Round(Model[0].Discount * 100 / Model[0].Price)%</div>
                </div>
                <div class="gia_goc_lon">
                    Giá gốc<br>
                    @(Model[0].Price)đ
                </div>
                <div class="tiet_kiem_lon">
                    Tiết kiệm<br>
                    @(Model[0].Discount)đ
                </div>
                <div class="wrap_clock">
                    <strong>Thời gian khuyến mãi đến</strong>
                    <div class="box_clock_day">
                        <div class="hour" style="width: 54px;">
                            @Model[0].Date_end.Day.ToString("00")</div>
                        <div class="hour" style="width: 58px;">
                            @Model[0].Date_end.Month.ToString("00")</div>
                        <div class="hour" style="width: 85px;">
                            @Model[0].Date_end.Year</div>
                    </div>
                </div>
                <div class="box_luotmua_lon">
                    Đã có <span class="phieudamua">@Model[0].NumberOfPurchased</span> lượt mua<br>
                    <span class="phieuconlai">Còn lại @(Model[0].TotalOfNumber - Model[0].NumberOfPurchased) cơ hội</span>
                </div>
            </div>
            <div id="img_deal_lon">
                @{Html.RenderPartial("_PartialSildeShow");}
            </div>
            <div style="height: 5px; clear: both;">
            </div>
        </div>
        }
        <!-------END Box Deal lon---------->
        <!-------Begin box deal nho---------->
        @for (int i = 1; i < Model.Count; i++)
        {
           
            <div class="box_deal_nho">
                <div class="title_deal_nho">
                    <span class="vitri_deal_nho">
                        @Html.ActionLink(Model[i].Catalogy.NameCatalogy, "Filter", "Home", new { IDCatalogy = Model[i].IDCatalogy }, null)
                    </span>
                    @Html.ActionLink(Model[i].NameProduct, "Details", new { idProduct = Model[i].IDProduct })
                </div>
                <div id="img_deal_nho">
                    
                    <img src="@(((Model[i].Images.Count > 0) ? Model[i].Images.ElementAt(0).Path : "/Content/Images/no-images.png"))" width="320"
                        height="223">
                    <div id="tem_nho">
                        <div class="text_giam_nho">
                            GIẢM</div>
                        <div class="phantram_nho">@Math.Round(Model[i].Discount * 100 / Model[i].Price)%</div>
                    </div>
                    <div id="wrap_tg_phieu">
                        <script>
                            callTimeMini(@i);
                        </script>
                        <div class="thoigian_nho">
                            <span time="@(Math.Round((Model[i].Date_end - new DateTime(1970, 1, 1, 7, 0, 0)).TotalSeconds, 0))" id="kkcount-down-@(i)">
                            </span>
                        </div>
                        <div class="sophieumua_nho">
                            <span class="luotmua_nho">@Model[i].NumberOfPurchased</span> lượt mua</div>
                    </div>
                </div>
                <div id="gia_goc_deal_nho">
                    Giá gốc: @(Model[i].Price)đ<br>
                    Tiết kiệm: @(Model[i].Discount)đ
                    <div id="arrow_nho">
                        <div class="gia_deal_nho">@(Model[i].Price - Model[i].Discount)đ</div>
                        <div class="button_nho">
                            <input type="button" class="btn_mua_nho" onclick="location.href='@Url.Action("ShoppingCart", "Home", new { idProduct = Model[i].IDProduct })'"></div>
                    </div>
                </div>
            </div>
                                                                                        if (i % 2 == 1)
                                                                                        {
            <div style="width: 20px; float: left">
                <img src="/Content/DefaultThemes/Images/space.gif" width="20px" height="20px"></div>            
                                                                                        }
        }
        <!-------END box deal nho---------->
      
    </div>
</body>
</html>
